<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue2的模板编译</title>
</head>
<body>
  <!-- hello, {{ name }} 欢迎到来
  <span class="text" style="color: green;">{{age}}</span>
  <p>学习学习,多看多写</p> -->
  
  <div id="app" style="color: red;font-size: 20px;">

    hello, {{ name }}
    <h1>{{ hobby[1] }}</h1>
    <ul>
      <li style="color: green">{{ age }}</li>
      <li>{{ info.status }}</li>
    </ul>
      
  </div>

  <script src="dist/umd/vue.js"></script>
  <script>
    // 模板： render -> template -> html式模板
    const vm = new Vue({
      el: '#app',
  //     template: `<div id="app" style="color: red;font-size: 20px;">
  //   hello, {{ name }}
  //   <span class="text" style="color: green;">{{age}}</span>
  // </div>`,
      // render(h) {},
      data() {
        return {
          name: 'charlie',
          age: 21,
          info: {
            status: 'studying',
            friends: [
              {
                id: 1,
                name: '小张'
              },
              {
                id: 2,
                name: '小王'
              }
            ]
          },
          hobby: ['games', 'travel', 'film']
        }
      }
    })

    // console.log(vm);

  </script>
</body>
</html>